<?php

class MemberWork extends AppModel {
	var $name = "MemberWork";
	var $useTable = "member_work_info";
	var $primaryKey = 'id';
	
	var $belongsTo = array(
			
		'SysParams20'=>array(
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"exp_work_position" = "SysParams20"."id" AND "SysParams20"."kbn"=\'work_position_id\' and "SysParams20"."id"' 
		), 
		'SysParams30'=>array(
			'className'=>'SysParams', 'order'=>'', 
			'foreignKey'=>'"exp_work_emp_type"="SysParams30"."id" AND "SysParams30"."kbn"=\'work_emp_type_id\' and "SysParams30"."id"' 
		) 
	);
	
	function doDelete($id) {
		
		$sql = "update member_work_info MemberWork set deleted=now() " . " where MemberWork.id in ($id)";
		$this->query($sql);
	}

	/*
	 * @author wang.wei add
	* 2012/03/14
	* */
	function doDeleteFormMemberId($member_id) {
	
		$sql = "update member_work_info MemberWork set deleted=now() " . " where MemberWork.member_id = '$member_id' and deleted is null";
		$this->query($sql);
	}
}
?>